Optimal. Leaf size=196 \[ \frac{2 B^2 (b c-a d) \text{PolyLog}\left (2,\frac{(a+b x) (d f-c g)}{(c+d x) (b f-a g)}\right )}{(b f-a g) (d f-c g)}+\frac{2 B (b c-a d) \log \left (1-\frac{(a+b x) (d f-c g)}{(c+d x) (b f-a g)}\right ) \left (B \log \left (\frac{e (a+b x)}{c+d x}\right )+A\right )}{(b f-a g) (d f-c g)}+\frac{(a+b x) \left (B \log \left (\frac{e (a+b x)}{c+d x}\right )+A\right )^2}{(f+g x) (b f-a g)} \]
[Out]
________________________________________________________________________________________
Rubi [B] time = 1.1194, antiderivative size = 612, normalized size of antiderivative = 3.12, number of steps used = 32, number of rules used = 10, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.345, Rules used = {2525, 12, 2528, 2524, 2418, 2390, 2301, 2394, 2393, 2391} \[ \frac{2 b B^2 \text{PolyLog}\left (2,-\frac{d (a+b x)}{b c-a d}\right )}{g (b f-a g)}+\frac{2 B^2 d \text{PolyLog}\left (2,\frac{b (c+d x)}{b c-a d}\right )}{g (d f-c g)}-\frac{2 B^2 (b c-a d) \text{PolyLog}\left (2,\frac{b (f+g x)}{b f-a g}\right )}{(b f-a g) (d f-c g)}+\frac{2 B^2 (b c-a d) \text{PolyLog}\left (2,\frac{d (f+g x)}{d f-c g}\right )}{(b f-a g) (d f-c g)}+\frac{2 b B \log (a+b x) \left (B \log \left (\frac{e (a+b x)}{c+d x}\right )+A\right )}{g (b f-a g)}-\frac{2 B d \log (c+d x) \left (B \log \left (\frac{e (a+b x)}{c+d x}\right )+A\right )}{g (d f-c g)}+\frac{2 B (b c-a d) \log (f+g x) \left (B \log \left (\frac{e (a+b x)}{c+d x}\right )+A\right )}{(b f-a g) (d f-c g)}-\frac{\left (B \log \left (\frac{e (a+b x)}{c+d x}\right )+A\right )^2}{g (f+g x)}+\frac{2 B^2 d \log (c+d x) \log \left (-\frac{d (a+b x)}{b c-a d}\right )}{g (d f-c g)}+\frac{2 b B^2 \log (a+b x) \log \left (\frac{b (c+d x)}{b c-a d}\right )}{g (b f-a g)}-\frac{2 B^2 (b c-a d) \log (f+g x) \log \left (-\frac{g (a+b x)}{b f-a g}\right )}{(b f-a g) (d f-c g)}+\frac{2 B^2 (b c-a d) \log (f+g x) \log \left (-\frac{g (c+d x)}{d f-c g}\right )}{(b f-a g) (d f-c g)}-\frac{b B^2 \log ^2(a+b x)}{g (b f-a g)}-\frac{B^2 d \log ^2(c+d x)}{g (d f-c g)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2525
Rule 12
Rule 2528
Rule 2524
Rule 2418
Rule 2390
Rule 2301
Rule 2394
Rule 2393
Rule 2391
Rubi steps
\begin{align*} \int \frac{\left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right )^2}{(f+g x)^2} \, dx &=-\frac{\left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right )^2}{g (f+g x)}+\frac{(2 B) \int \frac{(b c-a d) \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right )}{(a+b x) (c+d x) (f+g x)} \, dx}{g}\\ &=-\frac{\left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right )^2}{g (f+g x)}+\frac{(2 B (b c-a d)) \int \frac{A+B \log \left (\frac{e (a+b x)}{c+d x}\right )}{(a+b x) (c+d x) (f+g x)} \, dx}{g}\\ &=-\frac{\left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right )^2}{g (f+g x)}+\frac{(2 B (b c-a d)) \int \left (\frac{b^2 \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right )}{(b c-a d) (b f-a g) (a+b x)}+\frac{d^2 \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right )}{(b c-a d) (-d f+c g) (c+d x)}+\frac{g^2 \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right )}{(b f-a g) (d f-c g) (f+g x)}\right ) \, dx}{g}\\ &=-\frac{\left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right )^2}{g (f+g x)}+\frac{\left (2 b^2 B\right ) \int \frac{A+B \log \left (\frac{e (a+b x)}{c+d x}\right )}{a+b x} \, dx}{g (b f-a g)}-\frac{\left (2 B d^2\right ) \int \frac{A+B \log \left (\frac{e (a+b x)}{c+d x}\right )}{c+d x} \, dx}{g (d f-c g)}+\frac{(2 B (b c-a d) g) \int \frac{A+B \log \left (\frac{e (a+b x)}{c+d x}\right )}{f+g x} \, dx}{(b f-a g) (d f-c g)}\\ &=\frac{2 b B \log (a+b x) \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right )}{g (b f-a g)}-\frac{\left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right )^2}{g (f+g x)}-\frac{2 B d \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right ) \log (c+d x)}{g (d f-c g)}+\frac{2 B (b c-a d) \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right ) \log (f+g x)}{(b f-a g) (d f-c g)}-\frac{\left (2 b B^2\right ) \int \frac{(c+d x) \left (-\frac{d e (a+b x)}{(c+d x)^2}+\frac{b e}{c+d x}\right ) \log (a+b x)}{e (a+b x)} \, dx}{g (b f-a g)}+\frac{\left (2 B^2 d\right ) \int \frac{(c+d x) \left (-\frac{d e (a+b x)}{(c+d x)^2}+\frac{b e}{c+d x}\right ) \log (c+d x)}{e (a+b x)} \, dx}{g (d f-c g)}-\frac{\left (2 B^2 (b c-a d)\right ) \int \frac{(c+d x) \left (-\frac{d e (a+b x)}{(c+d x)^2}+\frac{b e}{c+d x}\right ) \log (f+g x)}{e (a+b x)} \, dx}{(b f-a g) (d f-c g)}\\ &=\frac{2 b B \log (a+b x) \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right )}{g (b f-a g)}-\frac{\left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right )^2}{g (f+g x)}-\frac{2 B d \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right ) \log (c+d x)}{g (d f-c g)}+\frac{2 B (b c-a d) \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right ) \log (f+g x)}{(b f-a g) (d f-c g)}-\frac{\left (2 b B^2\right ) \int \frac{(c+d x) \left (-\frac{d e (a+b x)}{(c+d x)^2}+\frac{b e}{c+d x}\right ) \log (a+b x)}{a+b x} \, dx}{e g (b f-a g)}+\frac{\left (2 B^2 d\right ) \int \frac{(c+d x) \left (-\frac{d e (a+b x)}{(c+d x)^2}+\frac{b e}{c+d x}\right ) \log (c+d x)}{a+b x} \, dx}{e g (d f-c g)}-\frac{\left (2 B^2 (b c-a d)\right ) \int \frac{(c+d x) \left (-\frac{d e (a+b x)}{(c+d x)^2}+\frac{b e}{c+d x}\right ) \log (f+g x)}{a+b x} \, dx}{e (b f-a g) (d f-c g)}\\ &=\frac{2 b B \log (a+b x) \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right )}{g (b f-a g)}-\frac{\left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right )^2}{g (f+g x)}-\frac{2 B d \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right ) \log (c+d x)}{g (d f-c g)}+\frac{2 B (b c-a d) \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right ) \log (f+g x)}{(b f-a g) (d f-c g)}-\frac{\left (2 b B^2\right ) \int \left (\frac{b e \log (a+b x)}{a+b x}-\frac{d e \log (a+b x)}{c+d x}\right ) \, dx}{e g (b f-a g)}+\frac{\left (2 B^2 d\right ) \int \left (\frac{b e \log (c+d x)}{a+b x}-\frac{d e \log (c+d x)}{c+d x}\right ) \, dx}{e g (d f-c g)}-\frac{\left (2 B^2 (b c-a d)\right ) \int \left (\frac{b e \log (f+g x)}{a+b x}-\frac{d e \log (f+g x)}{c+d x}\right ) \, dx}{e (b f-a g) (d f-c g)}\\ &=\frac{2 b B \log (a+b x) \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right )}{g (b f-a g)}-\frac{\left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right )^2}{g (f+g x)}-\frac{2 B d \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right ) \log (c+d x)}{g (d f-c g)}+\frac{2 B (b c-a d) \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right ) \log (f+g x)}{(b f-a g) (d f-c g)}-\frac{\left (2 b^2 B^2\right ) \int \frac{\log (a+b x)}{a+b x} \, dx}{g (b f-a g)}+\frac{\left (2 b B^2 d\right ) \int \frac{\log (a+b x)}{c+d x} \, dx}{g (b f-a g)}+\frac{\left (2 b B^2 d\right ) \int \frac{\log (c+d x)}{a+b x} \, dx}{g (d f-c g)}-\frac{\left (2 B^2 d^2\right ) \int \frac{\log (c+d x)}{c+d x} \, dx}{g (d f-c g)}-\frac{\left (2 b B^2 (b c-a d)\right ) \int \frac{\log (f+g x)}{a+b x} \, dx}{(b f-a g) (d f-c g)}+\frac{\left (2 B^2 d (b c-a d)\right ) \int \frac{\log (f+g x)}{c+d x} \, dx}{(b f-a g) (d f-c g)}\\ &=\frac{2 b B \log (a+b x) \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right )}{g (b f-a g)}-\frac{\left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right )^2}{g (f+g x)}+\frac{2 B^2 d \log \left (-\frac{d (a+b x)}{b c-a d}\right ) \log (c+d x)}{g (d f-c g)}-\frac{2 B d \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right ) \log (c+d x)}{g (d f-c g)}+\frac{2 b B^2 \log (a+b x) \log \left (\frac{b (c+d x)}{b c-a d}\right )}{g (b f-a g)}-\frac{2 B^2 (b c-a d) \log \left (-\frac{g (a+b x)}{b f-a g}\right ) \log (f+g x)}{(b f-a g) (d f-c g)}+\frac{2 B (b c-a d) \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right ) \log (f+g x)}{(b f-a g) (d f-c g)}+\frac{2 B^2 (b c-a d) \log \left (-\frac{g (c+d x)}{d f-c g}\right ) \log (f+g x)}{(b f-a g) (d f-c g)}-\frac{\left (2 b B^2\right ) \operatorname{Subst}\left (\int \frac{\log (x)}{x} \, dx,x,a+b x\right )}{g (b f-a g)}-\frac{\left (2 b^2 B^2\right ) \int \frac{\log \left (\frac{b (c+d x)}{b c-a d}\right )}{a+b x} \, dx}{g (b f-a g)}-\frac{\left (2 B^2 d\right ) \operatorname{Subst}\left (\int \frac{\log (x)}{x} \, dx,x,c+d x\right )}{g (d f-c g)}-\frac{\left (2 B^2 d^2\right ) \int \frac{\log \left (\frac{d (a+b x)}{-b c+a d}\right )}{c+d x} \, dx}{g (d f-c g)}+\frac{\left (2 B^2 (b c-a d) g\right ) \int \frac{\log \left (\frac{g (a+b x)}{-b f+a g}\right )}{f+g x} \, dx}{(b f-a g) (d f-c g)}-\frac{\left (2 B^2 (b c-a d) g\right ) \int \frac{\log \left (\frac{g (c+d x)}{-d f+c g}\right )}{f+g x} \, dx}{(b f-a g) (d f-c g)}\\ &=-\frac{b B^2 \log ^2(a+b x)}{g (b f-a g)}+\frac{2 b B \log (a+b x) \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right )}{g (b f-a g)}-\frac{\left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right )^2}{g (f+g x)}+\frac{2 B^2 d \log \left (-\frac{d (a+b x)}{b c-a d}\right ) \log (c+d x)}{g (d f-c g)}-\frac{2 B d \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right ) \log (c+d x)}{g (d f-c g)}-\frac{B^2 d \log ^2(c+d x)}{g (d f-c g)}+\frac{2 b B^2 \log (a+b x) \log \left (\frac{b (c+d x)}{b c-a d}\right )}{g (b f-a g)}-\frac{2 B^2 (b c-a d) \log \left (-\frac{g (a+b x)}{b f-a g}\right ) \log (f+g x)}{(b f-a g) (d f-c g)}+\frac{2 B (b c-a d) \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right ) \log (f+g x)}{(b f-a g) (d f-c g)}+\frac{2 B^2 (b c-a d) \log \left (-\frac{g (c+d x)}{d f-c g}\right ) \log (f+g x)}{(b f-a g) (d f-c g)}-\frac{\left (2 b B^2\right ) \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{d x}{b c-a d}\right )}{x} \, dx,x,a+b x\right )}{g (b f-a g)}-\frac{\left (2 B^2 d\right ) \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{b x}{-b c+a d}\right )}{x} \, dx,x,c+d x\right )}{g (d f-c g)}+\frac{\left (2 B^2 (b c-a d)\right ) \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{b x}{-b f+a g}\right )}{x} \, dx,x,f+g x\right )}{(b f-a g) (d f-c g)}-\frac{\left (2 B^2 (b c-a d)\right ) \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{d x}{-d f+c g}\right )}{x} \, dx,x,f+g x\right )}{(b f-a g) (d f-c g)}\\ &=-\frac{b B^2 \log ^2(a+b x)}{g (b f-a g)}+\frac{2 b B \log (a+b x) \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right )}{g (b f-a g)}-\frac{\left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right )^2}{g (f+g x)}+\frac{2 B^2 d \log \left (-\frac{d (a+b x)}{b c-a d}\right ) \log (c+d x)}{g (d f-c g)}-\frac{2 B d \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right ) \log (c+d x)}{g (d f-c g)}-\frac{B^2 d \log ^2(c+d x)}{g (d f-c g)}+\frac{2 b B^2 \log (a+b x) \log \left (\frac{b (c+d x)}{b c-a d}\right )}{g (b f-a g)}-\frac{2 B^2 (b c-a d) \log \left (-\frac{g (a+b x)}{b f-a g}\right ) \log (f+g x)}{(b f-a g) (d f-c g)}+\frac{2 B (b c-a d) \left (A+B \log \left (\frac{e (a+b x)}{c+d x}\right )\right ) \log (f+g x)}{(b f-a g) (d f-c g)}+\frac{2 B^2 (b c-a d) \log \left (-\frac{g (c+d x)}{d f-c g}\right ) \log (f+g x)}{(b f-a g) (d f-c g)}+\frac{2 b B^2 \text{Li}_2\left (-\frac{d (a+b x)}{b c-a d}\right )}{g (b f-a g)}+\frac{2 B^2 d \text{Li}_2\left (\frac{b (c+d x)}{b c-a d}\right )}{g (d f-c g)}-\frac{2 B^2 (b c-a d) \text{Li}_2\left (\frac{b (f+g x)}{b f-a g}\right )}{(b f-a g) (d f-c g)}+\frac{2 B^2 (b c-a d) \text{Li}_2\left (\frac{d (f+g x)}{d f-c g}\right )}{(b f-a g) (d f-c g)}\\ \end{align*}
Mathematica [B] time = 0.958893, size = 402, normalized size = 2.05 \[ \frac{\frac{B \left (-b B (d f-c g) \left (\log (a+b x) \left (\log (a+b x)-2 \log \left (\frac{b (c+d x)}{b c-a d}\right )\right )-2 \text{PolyLog}\left (2,\frac{d (a+b x)}{a d-b c}\right )\right )+B d (b f-a g) \left (2 \text{PolyLog}\left (2,\frac{b (c+d x)}{b c-a d}\right )+\log (c+d x) \left (2 \log \left (\frac{d (a+b x)}{a d-b c}\right )-\log (c+d x)\right )\right )-2 B g (b c-a d) \left (\text{PolyLog}\left (2,\frac{b (f+g x)}{b f-a g}\right )-\text{PolyLog}\left (2,\frac{d (f+g x)}{d f-c g}\right )+\log (f+g x) \left (\log \left (\frac{g (a+b x)}{a g-b f}\right )-\log \left (\frac{g (c+d x)}{c g-d f}\right )\right )\right )+2 b \log (a+b x) (d f-c g) \left (B \log \left (\frac{e (a+b x)}{c+d x}\right )+A\right )-2 d (b f-a g) \log (c+d x) \left (B \log \left (\frac{e (a+b x)}{c+d x}\right )+A\right )+2 g (b c-a d) \log (f+g x) \left (B \log \left (\frac{e (a+b x)}{c+d x}\right )+A\right )\right )}{(b f-a g) (d f-c g)}-\frac{\left (B \log \left (\frac{e (a+b x)}{c+d x}\right )+A\right )^2}{f+g x}}{g} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 2.067, size = 0, normalized size = 0. \begin{align*} \int{\frac{1}{ \left ( gx+f \right ) ^{2}} \left ( A+B\ln \left ({\frac{e \left ( bx+a \right ) }{dx+c}} \right ) \right ) ^{2}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} 2 \, A B{\left (\frac{b \log \left (b x + a\right )}{b f g - a g^{2}} - \frac{d \log \left (d x + c\right )}{d f g - c g^{2}} + \frac{{\left (b c - a d\right )} \log \left (g x + f\right )}{b d f^{2} + a c g^{2} -{\left (b c + a d\right )} f g} - \frac{\log \left (\frac{b e x}{d x + c} + \frac{a e}{d x + c}\right )}{g^{2} x + f g}\right )} - B^{2}{\left (\frac{\log \left (d x + c\right )^{2}}{g^{2} x + f g} + \int -\frac{d g x \log \left (e\right )^{2} + c g \log \left (e\right )^{2} +{\left (d g x + c g\right )} \log \left (b x + a\right )^{2} + 2 \,{\left (d g x \log \left (e\right ) + c g \log \left (e\right )\right )} \log \left (b x + a\right ) - 2 \,{\left ({\left (g \log \left (e\right ) - g\right )} d x + c g \log \left (e\right ) - d f +{\left (d g x + c g\right )} \log \left (b x + a\right )\right )} \log \left (d x + c\right )}{d g^{3} x^{3} + c f^{2} g +{\left (2 \, d f g^{2} + c g^{3}\right )} x^{2} +{\left (d f^{2} g + 2 \, c f g^{2}\right )} x}\,{d x}\right )} - \frac{A^{2}}{g^{2} x + f g} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{B^{2} \log \left (\frac{b e x + a e}{d x + c}\right )^{2} + 2 \, A B \log \left (\frac{b e x + a e}{d x + c}\right ) + A^{2}}{g^{2} x^{2} + 2 \, f g x + f^{2}}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (B \log \left (\frac{{\left (b x + a\right )} e}{d x + c}\right ) + A\right )}^{2}}{{\left (g x + f\right )}^{2}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]